// 浮点数精度 height - medium - lowp ( 放在最前面，告知计算机应该如何计算浮点数 )
precision lowp float;

attribute vec3 position;
attribute vec2 uv;

uniform mat4 projectionMatrix;
uniform mat4 viewMatrix;
uniform mat4 modelMatrix;



// 输出变量
varying vec2 vUv;
varying float vElevation;
// 获取 uTime
uniform float uTime;

void main(){
    vUv = uv;
    vec4 modelPosition =  modelMatrix * vec4(position,1.0);

    modelPosition.z = sin( modelPosition.x + uTime * 2.0 ) * 5.0 * 0.05;
    modelPosition.z += sin( modelPosition.y + uTime * 2.0 ) * 5.0 * 0.05;
    vElevation = modelPosition.z;

    gl_Position = projectionMatrix * viewMatrix * modelPosition;
}